/**
 * Created by lee_mxue on 17/5/4.
 */
import React from "react";
import ReactDOM from "react-dom";
import { addErrorListener } from "../../lib/handleError"
import weixinShare from "../../lib/weixinShare"
import AJAX from "../../lib/ajax"
require('../../styles/common.less');
require('../../lib/rem');
require('./CabinetGuidance.less');

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            isReady: false, //是否可以加载页面
            code: "",
            text1: "",
            text2: "",
        }
    }

    componentWillMount() {
        addErrorListener()()
        weixinShare.hideAll()
    }
    
    componentDidMount() {
        AJAX.appendBaiduAnalysis()
        this.setState({
            isReady: true, //是否可以加载页面
        })
    }

    next() {
        window.localStorage.setItem('read_guide', true)
        window.location.href = "./CabinetSendingHeader"
    }

    render() {
        return (
            this.state.isReady &&
            <div className="main">
                <div className="center_content">
                    <div className="flex">
                        <img src="http://cdn.jinlb.cn/pic/2d/89/2d898d5d606c93e9a9e65fe7e9deeb9f.png" alt=""/>
                        <div className="flex1">1.微信填单</div>
                    </div>
                    <div className="flex">
                        <img src="http://cdn.jinlb.cn/pic/92/21/922136fd1c1a8a6a88996824236925ca.png" alt=""/>
                        <div className="flex1">2.携带物品到近邻宝智能柜</div>
                    </div>
                    <div className="flex">
                        <img src="http://cdn.jinlb.cn/pic/c0/c1/c0c1ce6d86eaf0278769a4a32beae0d2.png" alt=""/>
                        <div className="flex1">3.扫码开箱</div>
                    </div>
                    <div className="flex">
                        <img src="http://cdn.jinlb.cn/pic/f0/a1/f0a1162177e6663d63d9159889ae3a06.png" alt=""/>
                        <div className="flex1">4.放入快递关好格口</div>
                    </div>

                    <div className="tips">
                        <h3>温馨提示</h3>
                        <div className="flex">
                            <div className="flex1">
                                <img src="http://cdn.jinlb.cn/pic/a0/d8/a0d804ec88e3914555cdd7b1fb53b0ab.png" alt=""/>
                                <p>3C、易碎、贵重用箱装</p>
                            </div>
                            <div className="flex1">
                                <img src="http://cdn.jinlb.cn/pic/4c/07/4c07a8b0ccb5fa1cbb16a14d746eeb4c.png" alt=""/>
                                <p>文件、衣物、食品用袋装</p>
                            </div>

                        </div>
                    </div>

                </div>
                <div className="bottom_submit">
                    <a className="weui-btn weui-btn_primary yellow" href="javascript:;"
                       onClick={this.next.bind(this)}>去寄件</a>
                </div>
            </div>

        )
    }
}
ReactDOM.render(<App />, document.getElementById('app'))
if (module.hot) {
    module.hot.accept();
}